<template>
	<view class="invite">
		<view class="nav">
			<uni-nav-bar backgroundColor="transparent" left-icon="left" fixed @clickLeft="goback"></uni-nav-bar>
		</view>

		
		
		<button class="btn" @click="onShare">立即邀请好友领取代金券</button>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {
					mobile: '',
					code: '',
				},
				
				i:60,
				flag:false,
				text:'获取验证码',
				
			}
		},
		methods: {
			goback(){ uni.navigateBack() },
			onShare(){
				this.request.httpTokenRequest({
					url: "index/getShareConfig",
					method: "get"
				}, {
					type:1
				}).then(data => {
					if (data.code == 0) {
						uni.share({
							provider: "weixin",
							scene: "WXSceneSession",
							type: 0,
							href: data.data.path + '?pid=' + uni.getStorageSync('user').id, // 跳转链接
							title: data.data.title, // 分享标题
							summary: data.data.content,
							imageUrl: data.data.image,
							success: function (res) {
								// console.log("success:" + JSON.stringify(res));
							},
							fail: function (err) {
								console.log("fail:" + JSON.stringify(err));
							}
						});
					}else {
						this.$util.msg(data.msg)
					}
				}, error => {})
				
			},
		}
	}
</script>

<style lang="scss" scoped>
	.invite {
		background: url(https://qiniu-cdn.maeiyun.com/imgs/mine/invite_bg.png) 0 0 no-repeat;
		background-size: 100%;
		display: flex;
		align-items: center;
		flex-direction: column;
		min-height: 100vh;
		background-color: #FEB884;
		padding-top: 1560rpx;
	}
	.nav {
		padding-top: var(--status-bar-height);
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		background: url(https://qiniu-cdn.maeiyun.com/imgs/mine/invite_bg.png) 0 0 no-repeat;
		background-size: 100%;
	}

	

	.btn {
		background: linear-gradient(180deg, rgba(254, 239, 205, 1.000000) 0, rgba(253, 184, 13, 1.000000) 100.000000%);
		border-radius: 46rpx;
		height: 93rpx;
		display: flex;
		flex-direction: column;
		width: 701rpx;
		margin: 50rpx 0 60rpx;
		font-weight: 600;
		color: #EF1926;
		line-height: 93rpx;
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		bottom: 20rpx;
	}
</style>